package com.coolingme.springcloud.dubbo.springclouddubboconsumer;

import com.coolingme.springcloud.dubbo.ISayHelloService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangyue
 * @date 2022/9/30 22:06
 */
@RestController
@EnableDiscoveryClient
@SpringBootApplication
public class SpringCloudDubboConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringCloudDubboConsumerApplication.class, args);
    }

    @Reference(check = false)
    ISayHelloService sayHelloService;

    @GetMapping("/say")
    public String sayHello() {
        return this.sayHelloService.sayHello("Joey");
    }


}
